package com.shop.shoporder.service.impl;

import com.shop.shoporder.entity.ShortUrl;
import com.shop.shoporder.mapper.ShortUrlMapper;
import com.shop.shoporder.service.ShortUrlService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service("shortUrlService")
public class ShortUrlServiceImpl implements ShortUrlService {


    @Autowired
    ShortUrlMapper shortUrlMapper;


    @Override
    public int deleteByPrimaryKey(Integer id) {
        return shortUrlMapper.deleteByPrimaryKey(id);
    }

    @Override
    public int insert(ShortUrl record) {
        return shortUrlMapper.insert(record);
    }
    @Transactional
    @Override
    public int insertSelective(ShortUrl record) {
        return shortUrlMapper.insertSelective(record);
    }

    @Override
    public ShortUrl selectByPrimaryKey(Integer id) {
        return shortUrlMapper.selectByPrimaryKey(id);
    }

    @Override
    public int updateByPrimaryKeySelective(ShortUrl record) {
        return shortUrlMapper.updateByPrimaryKeySelective(record);
    }

    @Override
    public int updateByPrimaryKey(ShortUrl record) {
        return shortUrlMapper.updateByPrimaryKey(record);
    }

    @Override
    public ShortUrl selectByKey(String shortKey) {
        return shortUrlMapper.selectByKey(shortKey);
    }
}
